/**
 * 
 */
package com.morningstar.qs.api.basic.common.data;

/**
 * @author rzeng
 * @deprecated
 *
 */
public enum SecurityType {
	All (-1),
	EQUITY (1),
	OPTION (2),
	FUTURE (3),
	MUTUALFUND (8),
	INDEX (10),
	FOREX (20);
	
    private final int value;

    private SecurityType(int value) {
        this.value = value;
    }
    
    public int getValue() {
        return value;
    }
    
    public static SecurityType getType(int value) {
    	SecurityType type = EQUITY;
    	if (All.getValue() == value) {
    		type = All;
    	} else if (OPTION.getValue() == value) {
    		type = OPTION;
    	} else if (FUTURE.getValue() == value) {
    		type = FUTURE;
    	} else if (MUTUALFUND.getValue() == value) {
    		type = MUTUALFUND;
    	} else if (INDEX.getValue() == value) {
    		type = INDEX;
    	} else if (FOREX.getValue() == value) {
    		type = FOREX;
    	}
		return type;
    }
    
    /*
    public static SecurityType getType(String value) {
    	SecurityType type = EQUITY;
    	if (null != value) {
    		if (value.trim().equals("Index")) {
    			type = INDEX;
    		}
    		if (value.trim().equals("Mutual Fund")) {
    			type = MUTUALFUND;
    		}
    		if (value.trim().equals("Option")) {
    			type = OPTION;
    		}
    		if (value.trim().equals("Future")) {
    			type = FUTURE;
    		}
    		if (value.trim().equals("Foreign Exchange")) {
    			type = FOREX;
    		}
    	}
		return type;
    }
    */
}
